VtOptionMenu object_name [options]
Creates an OptionMenu widget which is a menu system component that lets a user select one of several choices. Returns the OptionMenu widget's name.
OptionMenus are created like Pulldown menus: first the OptionMenu is created and then it is "filled" in with other widgets. (The Label class options are supported, so that the OptionMenus can be titled.)
Callbacks can be assigned to the individual widgets which make up the OptionMenu, or a callback can be assigned to the OptionMenu itself. If this is done, callbacks assigned to the OptionMenu children will be overridden and the OptionMenu callback will be called if any of the children are activated. The child which caused the callback to be called will be passed as callback data.
Additional Callback keys
The following code produces an OptionMenu with the options apple, orange, and kumquat:
set app [VtOpen "VtOptionMenu Demo"] set form [VtForm $app.form] set menu [VtOptionMenu $form.menu -label "Pick one:" set but1 [VtPushButton $menu.but1 -label apple] set but2 [VtPushButton $menu.but2 -label orange] set but3 [VtPushButton $menu.but3 -label kumquat] VtShowDialog $app.form VtMainLoop
This code produces the following:
See also: